package com.sk.cardeal.utils;

import android.app.Dialog;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.dyhdyh.widget.loading.factory.DialogFactory;
import com.sk.cardeal.R;


/**
 * Created by sk on 2017/6/28.
 */

public class MyDialogLoadingFactory implements DialogFactory {

    @Override
    public Dialog onCreateDialog(Context context) {
        Dialog dialog = new Dialog(context, R.style.dialog_theme);
        View view = LayoutInflater.from(context).inflate(R.layout.my_loading_factory,null);
        ImageView imageView = view.findViewById(R.id.load_img);
        Glide.with(context).load(R.mipmap.loading).into(imageView);
        dialog.setContentView(view);
        return dialog;
    }

    @Override
    public void setMessage(Dialog dialog, CharSequence message) {

    }

    @Override
    public int getAnimateStyleId() {
        return 0;
    }

}
